import type { H3Event } from 'h3';
/**
 * Creates context for an incoming request
 * @see https://trpc.io/docs/v11/context
 */
export async function createContext(event: H3Event) {
  const ajkUserName = getRequestHeader(event, 'agent-user-name');
  // todo 后续解析token
  return {
    event,
    user: {
      id: 0
    },
    ajkUserName: ajkUserName || ''
  };
}

export type Context = Awaited<ReturnType<typeof createContext>>;